package com.shycloud.mido.music.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shycloud.mido.music.domain.MisMyCollection;
import com.shycloud.mido.music.mapper.MisMyCollectionMapper;
import com.shycloud.mido.music.service.MisMyCollectionService;
import com.shycloud.mido.music.vo.MyCollectionVO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author nianhua.jiang
 */
@Service
@AllArgsConstructor
public class MisMyCollectionServiceImpl extends ServiceImpl<MisMyCollectionMapper, MisMyCollection> implements MisMyCollectionService {

	/** 【自定义曲集】mapper */
	private MisMyCollectionMapper misMyCollectionMapper;

	/**
	 * 分页获取【自定义曲集】列表
	 *
	 * @param page
	 * @param userId
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.shycloud.mido.music.vo.MyCollectionVO>
	 * @author nianhua.jiang
	 * @date 2020/5/9 10:44
	 */
	@Override
	public IPage<MyCollectionVO> getMyCollection(Page page, String userId) {
		return misMyCollectionMapper.getMyCollection(page, userId);
	}

	/**
	 * 获取自定义曲集的列表
	 *
	 * @param userId
	 * @return java.util.List<com.shycloud.mido.music.vo.MyCollectionVO>
	 * @author nianhua.jiang
	 * @date 2020/6/30 18:07
	 */
	@Override
	public List<MyCollectionVO> getMyCollection(String userId) {
		return misMyCollectionMapper.getMyCollection(userId);
	}

	/**
	 * 新建【自建曲集】后检索此曲集的信息
	 *
	 * @param id
	 * @return com.shycloud.mido.music.vo.MyCollectionVO
	 * @author nianhua.jiang
	 * @date 2020/6/19 14:22
	 */
	@Override
	public MyCollectionVO getMyCollectionSaveAfter(Integer id) {
		return misMyCollectionMapper.getMyCollectionSaveAfter(id);
	}

	@Override
	public List<MyCollectionVO> getMyCollectionByMini(String searchWord, String memberId) {
		return misMyCollectionMapper.getMyCollectionByMini(searchWord, memberId);
	}
}
